#include "MainMenuScene.hpp"

MainMenuScene::MainMenuScene() {
    isFontReady = false;
}

void MainMenuScene::Load() {
    #ifdef _DEBUG
    std::cout << "MainMenuScene::Load" << std::endl;

    mousePositionString = "X: 0, Y: 0";
    #endif

    if (!isFontReady) {
        font.LoadFromFile("arial.ttf");
    }
}

void MainMenuScene::Unload() {
    #ifdef _DEBUG
    std::cout << "MainMenuScene::Unload" << std::endl;
    #endif
}

void MainMenuScene::Update(sf::Event& event, sf::RenderWindow& app) {
    #ifdef _DEBUG
    // Mouse position
    if (event.Type == sf::Event::MouseMoved) {
        std::stringstream stringBuilder;
        stringBuilder << "X: " << event.MouseMove.X << ", "
                      << "Y: " << event.MouseMove.Y;

        mousePositionString = stringBuilder.str();
    }


    #endif

}

void MainMenuScene::Draw(sf::RenderWindow& app) {
    app.Clear(sf::Color(0, 0, 0));

    #ifdef _DEBUG
    // Mouse position
    sf::String mousePositionDebug(mousePositionString, font, 12);
    mousePositionDebug.Move(5.0f, 5.0f);

    app.Draw(mousePositionDebug);
    #endif
}
